// pages/sign/sign.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        sign_in: true,
        sign_on: '上班打卡',
        sign_color: 'greenyellow'
    },
    sign_on: function () {
        if (this.data.sign_in) {
            wx.getLocation({
                success: function (res) {
                    var latitude = res.latitude
                    var longitude = res.longitude
                    var speed = res.speed
                    var accuracy = res.accuracy
                    console.log(latitude)
                    console.log(longitude)
                    console.log(speed)
                    console.log(accuracy)
                },
            })



            this.setData({
                sign_in: false,
                sign_on: '下班打卡',
                sign_color: 'orange'
            })
        } else {
            this.setData({
                sign_in: true,
                sign_on: '上班打卡',
                sign_color: 'greenyellow'
            })
        }
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    }
})